package net.sunbeta.test.database ;

import java.sql.PreparedStatement ;
import java.sql.SQLException ;
import java.util.List ;

import org.apache.poi.hssf.record.formula.functions.T ;

public class RegistrationEntrySetter extends AbstractPreparedStatementSetter<RegistrationEntry> {
    public RegistrationEntrySetter(List<RegistrationEntry> objects) {
        super(objects) ;
    }

    public void fillStatement(RegistrationEntry entry, PreparedStatement statement) throws SQLException {
        //        long time = entry.getActionDate() == null ? System.currentTimeMillis() : entry.getActionDate().getTime() ;
        //        statement.setString(1, entry.getLogin()) ;
        //        statement.setTimestamp(2, new Timestamp(time)) ;
        //        statement.setShort(3, entry.getActionResult()) ;
        //        statement.setString(4, entry.getDeviceName()) ;
        //        String comment = entry.getComment() ;
        //        if (comment.length() > 8190)
        //            comment = comment.substring(0, 8190) ;
        //        statement.setString(5, comment) ;
        //        statement.setShort(6, entry.getAcessLevel().getLevel()) ;
        //        statement.setString(7, entry.getObjectType()) ;
        //        statement.setString(8, entry.getObjectCategory()) ;
        //        statement.setString(9, entry.getObjectId()) ;
        //        statement.setInt(10, entry.getEventType().getId()) ;
        //        statement.setString(11, entry.getActionName()) ;
        //        statement.setString(12, entry.getUserName()) ;
        //        statement.setShort(13, entry.isNotification() ? (short) 1 : (short) 0) ;
        //        statement.setString(14, entry.getRemoteAddress()) ;
        //        statement.setString(15, entry.toString()) ;
    }

    public void fillStatement(T object, PreparedStatement statement) throws SQLException {
        // TODO Auto-generated method stub

    }

    /**
     <bean id="preparedStatementsSetter" class="java.util.HashMap">
        <constructor-arg>
            <map>
                <entry key="com.blogspot.RegistrationEntry">
                    <value>com.otr.security.server.audit.sql.RegistrationEntrySetter</value>
                </entry>
                .....
                .....
            </map>
        </constructor-arg>
    </bean>
     */
}
